<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>飞行的火箭</title>
    <style>
      .huojian {
        width: 300px;
        position: absolute;
        left: 300px;
        top: 200px;
      }

      /* 定义震动动画 */
      @keyframes vibrate {
        0% {
          transform: translate(-30px, -30px);
        }
        100% {
          transform: translate(30px, 30px);
        }
      }

      /* 调用震动动画 */
      .animation-vibrate {
        animation: vibrate 1s linear infinite alternate;
      }

      .line {
        width: 1px;
        height: 160px;
        background-color: blue;
        position: absolute;
      }

      .pos1 {
        top: 200px;
        left: 400px;
      }

      .pos2 {
        top: 240px;
        left: 450px;
      }

      .pos3 {
        top: 290px;
        left: 500px;
      }

      .pos4 {
        top: 320px;
        left: 550px;
      }

      /* 倾斜从上往下移入再移出动画 */
      .animation-move {
        animation: move 1s linear var(--delay) infinite backwards;
      }

      @keyframes move {
        0% {
          opacity: 0;
          transform: rotate(55deg) translateY(-200px);
        }

        70% {
          opacity: 1;
        }

        100% {
          opacity: 0;
          transform: rotate(55deg) translateY(200px);
        }
      }
    </style>
  </head>
  <body>
    <img src="./images/rocket.png" class="huojian animation-vibrate" alt="rocket" />
    <div class="line pos1 animation-move" style="--delay: 0s"></div>
    <div class="line pos2 animation-move" style="--delay: 0.4s"></div>
    <div class="line pos3 animation-move" style="--delay: 0.6s"></div>
    <div class="line pos4 animation-move" style="--delay: 0.2s"></div>
  </body>
</html>
